import {POST,GET} from './request.js'   //封装自定义请求
/**
 * 
 * @param {*} type 请求方式 0get 1post
 * @param {*} url  请求地址 
 * @param {*} data 请求参数
 */
const requestData = async (type,url,data)=>{
    let res
    if(type == 1) res = await GET(url,data)
    if(type == 3) res = await GET(url,data,"/easyapi/doc/auth")
    if(type == 4) res = await  POST(url,data,"/easyapi/doc/auth")
    if(type == 2 ||!type) res = await POST(url,data)

    return res
}


export {requestData}